/*
 * EpollHandler.h
 *
 *  Created on: 2009-3-25
 *      Author: P.Weiwen
 *  Description: 能被Epoll轮询的I/O接口.
 */

#ifndef EPOLLHANDLER_H_
#define EPOLLHANDLER_H_
#include "EpollTypes.h"
#include "Epoller.h"
#include "EpollEventArg.h"
#include "../Object.h"

class Epoller;

class EpollHandler:public Object {
public:
	virtual int	OnRead(Epoller & sender,EpollEventArg & e) =0;
	virtual int OnWrite(Epoller & sender,EpollEventArg & e)=0;
	virtual int OnError(Epoller & sender,EpollEventArg & e)=0;
	virtual int	OnTimeOut(Epoller & sender,EpollEventArg & e) =0;
	virtual fd_t GetFd()	const =0;
	virtual EventType GetEvents() const =0;
	virtual ~EpollHandler();
};

#endif /* EPOLLHANDLER_H_ */
